﻿using EAS.Content.Projectiles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace EAS.Content.Buffs
{
    public class DolphinBuff : ModBuff
    {
        public override void SetStaticDefaults()
        {
            Main.buffNoTimeDisplay[Type] = true;
            Main.vanityPet[Type] = true;
        }
        public override void Update(Player player, ref int buffIndex)
        {
            bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<Dolphin>()] <= 0;
            if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
            {
                Projectile.NewProjectile(player.GetSource_Accessory(null), player.Center, Vector2.Zero, ModContent.ProjectileType<Dolphin>(), 0, 0f, player.whoAmI);
            }
        }
    }
}
